package com.ehome.poct.core.api.feign;

import com.ehome.poct.core.api.dto.check.OnlineCheckDTO;
import com.ehome.poct.core.api.vo.online.TodoOrderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 联机检测的feign客户端
 *
 * @author cq
 * @Date 2022-03-03 17:49
 */
@FeignClient(value = "${service.poct-core:}${service.suffix.poct-core:}",contextId = "OnlineCheckFeign")
public interface OnlineCheckClient {

    /**
     * 开始处理检测
     * @param checkDTO 推送到mqtt的消息
     * @return 带处理带列表
     */
    @PostMapping("/onlinecheckprocess/doonlinecheck")
    TodoOrderVO startOnline(OnlineCheckDTO checkDTO);

    /**
     * 获取待检测列表
     * @param clinicId 诊所ID
     * @return 诊所待检测的列表
     */
    @GetMapping("/onlinecheckprocess/todo/{clinicId}")
    List<TodoOrderVO> getTodoList(@PathVariable Long clinicId);

    /**
     * 删除联测待检测订单
     * @param recordId 联合检测记录ID
     */
    @DeleteMapping("/onlinecheckprocess/del/record/{recordId}")
    Boolean delTodoOrder(@PathVariable Long recordId);

    /**
     * 校验单子是否还正常存在
     * @param recordId 记录ID
     * @return
     */
    @GetMapping("/onlinecheckprocess/todo/isExist/{recordId}")
    Boolean todoIsExist (@PathVariable Long recordId);

    /**
     * 编辑联合单子
     * @param recordId 记录ID
     */
    @PutMapping("/onlinecheckprocess/edit/record/{recordId}")
    Boolean editUniRecord(@PathVariable Long recordId);
}
